#ifndef _EXTRA_MATH_H
#define _EXTRA_MATH_H

#include "SFML\Graphics.hpp"

namespace ExtraMath
{
	inline float clamp(float x, float a, float b)
	{
		return x < a ? a : (x > b ? b : x);
	}

	inline float distance(const sf::Vector2f& v1, const sf::Vector2f& v2)
	{
		float dx = v1.x - v2.x;
		float dy = v1.y - v2.y;
		return static_cast<float>(sqrt(dx * dx + dy * dy));
	}

	inline float distance(const float f1, const float f2)
	{
		float f = f1 - f2;
		return static_cast<float>(sqrt(f * f));
	}
};

#endif // _EXTRA_MATH_H
